<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			function fun1(){
				alert("第一个按钮被点击了")
			}
			function fun2(){
				const btn1=document.getElementById("first")
				btn1.addEventListener("click",fun1,false)
			}
			function fun3(){
				const btn1=document.getElementById("first")
				btn1.removeEventListener("click",fun1)
			}
		</script>
	</head>
	<body>
		<button id="first">按钮</button><br>
		<button onclick="fun2()">第一个按钮</button><br>
		<button onclick="fun3()">移除第一个按钮</button><br>
		<script type="text/javascript">
			const btn3=document.querySelectorAll("button")[2]
		</script>
	</body>
</html>
